//
//  ViewController.m
//  PDFJSWKReader
//
//  Created by limeng on 2018/7/27.
//  Copyright © 2018年 limeng. All rights reserved.
//

#import "ViewController.h"
#import "PDFJSWKViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake(100, 150, 100, 40)];
    [button setTitle:@"PDF" forState:UIControlStateNormal];
    button.backgroundColor = [UIColor redColor];
    [button addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
    
}

- (void)buttonClick:(UIButton *)button{
    PDFJSWKViewController *vc = [[PDFJSWKViewController alloc]init];
    vc.title = @"PDF";
    vc.startPage = 9;
    vc.pageNumber = 6;
    NSString *pdfFilePath = [[NSBundle mainBundle] pathForResource:@"git搭建" ofType:@"pdf"];
    vc.filePath = pdfFilePath;

    vc.readEndHandler = ^(NSDictionary *dict) {
        NSLog(@"阅读进度:%@", dict);
    };

    [self.navigationController pushViewController:vc animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
